﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Workflow.Domain.Enums;

namespace Workflow.Domain.Models
{
    /// <summary>
    /// 流程业务实例表
    /// </summary>
    [Table(nameof(WorkflowInstanceModel))]
    public class WorkflowInstanceModel:BaseEntity
    {
        /// <summary>
        /// 流程引擎实例ID
        /// </summary>
        public string WorkflowInstanceId { get; set; } = null!;
        /// <summary>
        /// 流程实例标题
        /// </summary>
        public string Title { get; set; } = null!;
        /// <summary>
        /// 流程表单内容(从前端序列化传进来)
        /// </summary>
        [Column(TypeName = "json")]
        public string? FormFields { get; set; }

        /// <summary>
        /// 发起人
        /// </summary>
        public long ApplicantUserId { get; set; }
        /// <summary>
        /// 发起人姓名
        /// </summary>
        public string ApplicantUserName { get; set; } = null!;
        /// <summary>
        /// 当前流程节点Id
        /// </summary>
        public string? CurrentStepId { get; set; }

        /// <summary>
        /// 当前流程节点名称
        /// </summary>
        public string? CurrentStepName { get; set; }

        /// <summary>
        /// 当前审批人(多个以逗号隔开)
        /// </summary>
        public string? CurrentAuditUsers { get; set; }

        /// <summary>
        /// 当前审核人ID(多个以逗号隔开)
        /// </summary>
        public string? CurrentAuditUserIds { get; set; }

        /// <summary>
        /// 驳回到的节点
        /// </summary>
        public string? RejectToStepId { get; set; }

        /// <summary>
        /// 实例状态
        /// </summary>
        public WorkflowInstanceStatuEnum StatuEnum { get; set; }
    }
}
